<template>
  <div class="back-top" v-show="isShow.value">
    <div class="top-img">
      <i class="el-icon-top"></i>
    </div>
    <div class="top-title">返回顶部</div>
  </div>
</template>
<script>
export default {
  props: ["isShow"],
};
</script>
<style scoped lang="scss">
.back-top {
  width: 80px;
  height: 80px;
  box-shadow: 0px 0px 18px 0px rgba(0, 0, 0, 0.14);
  cursor: pointer;
  background-color: #fff;
  transition: background-color 0.3s;
  z-index: 3;
  &:hover {
    background-color: rgb(255, 0, 0);
    color: #fff;
    .top-title {
      color: #fff;
    }
  }
  .top-img {
    width: 50px;
    height: 50px;
    margin: 0 auto;
    // background: skyblue;
    background-repeat: no-repeat;
    background-size: contain;
    box-sizing: border-box;
    padding-top: 15px;
    text-align: center;
    i {
      font-size: 35px;
    }
  }
  .top-title {
    color: #333;
    text-rendering: optimizeLegibility;
    font-size: 14px;
    text-align: center;
  }
}

.back-top {
  position: fixed;
  right: 5px;
  bottom: 18%;
}
</style>